Skip to content

PEGA status cron job#27570

Merged
breedbah merged 21 commits intomasterfrom
b_reed/cst-pega-cron-job
Apr 13, 2026
Merged

PEGA status cron job#27570
breedbah merged 21 commits intomasterfrom
b_reed/cst-pega-cron-job

Conversation

@breedbah
Copy link
Copy Markdown
Contributor

@breedbah breedbah commented Apr 3, 2026

  • Replace Flipper.enable/disable calls in poll_pega_status_job_spec.rb with allow(Flipper).to receive(:enabled?) stubs to prevent global state mutation between examples

@va-vsp-bot
Copy link
Copy Markdown
Collaborator

⚠️ The following Parameter Store values are invalid. Please make sure the values are correct and exist in AWS Parameter Store before merging:

  • /dsva-vagov/vets-api/dev/env_vars/ivc_champva/pega_api/status_path
  • /dsva-vagov/vets-api/prod/env_vars/ivc_champva/pega_api/status_path
  • /dsva-vagov/vets-api/sandbox/env_vars/ivc_champva/pega_api/status_path
  • /dsva-vagov/vets-api/staging/env_vars/ivc_champva/pega_api/status_path

@va-vsp-bot
Copy link
Copy Markdown
Collaborator

⚠️ The following Parameter Store values are invalid. Please make sure the values are correct and exist in AWS Parameter Store before merging:

  • /dsva-vagov/vets-api/dev/env_vars/ivc_champva/pega_api/status_path
  • /dsva-vagov/vets-api/prod/env_vars/ivc_champva/pega_api/status_path
  • /dsva-vagov/vets-api/sandbox/env_vars/ivc_champva/pega_api/status_path
  • /dsva-vagov/vets-api/staging/env_vars/ivc_champva/pega_api/status_path

@va-vsp-bot
Copy link
Copy Markdown
Collaborator

⚠️ The following Parameter Store values are invalid. Please make sure the values are correct and exist in AWS Parameter Store before merging:

  • /dsva-vagov/vets-api/dev/env_vars/ivc_champva/pega_api/status_path
  • /dsva-vagov/vets-api/prod/env_vars/ivc_champva/pega_api/status_path
  • /dsva-vagov/vets-api/sandbox/env_vars/ivc_champva/pega_api/status_path
  • /dsva-vagov/vets-api/staging/env_vars/ivc_champva/pega_api/status_path

@breedbah breedbah self-assigned this Apr 6, 2026
@va-vsp-bot
Copy link
Copy Markdown
Collaborator

⚠️ The following Parameter Store values are invalid. Please make sure the values are correct and exist in AWS Parameter Store before merging:

  • /dsva-vagov/vets-api/dev/env_vars/ivc_champva/pega_api/status_path
  • /dsva-vagov/vets-api/prod/env_vars/ivc_champva/pega_api/status_path
  • /dsva-vagov/vets-api/sandbox/env_vars/ivc_champva/pega_api/status_path
  • /dsva-vagov/vets-api/staging/env_vars/ivc_champva/pega_api/status_path

@breedbah breedbah marked this pull request as ready for review April 6, 2026 18:03
@breedbah breedbah requested review from a team as code owners April 6, 2026 18:03
Copilot AI review requested due to automatic review settings April 6, 2026 18:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a scheduled IVC CHAMPVA Sidekiq cron job to poll the PEGA status endpoint by form UUID and persist refreshed pega_status / case_id values back onto ivc_champva_forms, plus supporting PEGA client/config plumbing and unit tests.

Changes:

  • Introduces IvcChampva::PollPegaStatusJob and registers it as a daily periodic job.
  • Adds status_path configuration and a new PegaApi::Client#get_status_by_uuid method to call the PEGA status endpoint.
  • Persists submitted_by_icn on CHAMPVA form inserts and adds job specs covering polling/update behavior.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
modules/ivc_champva/app/jobs/ivc_champva/poll_pega_status_job.rb New daily polling job that selects non-terminal forms, calls PEGA by UUID, and conditionally updates DB rows.
modules/ivc_champva/spec/jobs/poll_pega_status_job_spec.rb New unit spec suite for the polling job across multiple response and record-state scenarios.
modules/ivc_champva/lib/pega_api/client.rb Adds get_status_by_uuid GET call and response parsing for the double-encoded PEGA status response.
modules/ivc_champva/lib/pega_api/configuration.rb Adds status_path accessor for PEGA status endpoint routing.
modules/ivc_champva/app/services/ivc_champva/file_uploader.rb Adds persistence of submitted_by_icn during form row creation.
lib/periodic_jobs.rb Registers the new polling job on a daily cron schedule.
config/settings.yml Adds required ivc_champva.pega_api.status_path setting (env-backed).
config/settings/development.yml Switches PEGA settings to env-backed values with development fallbacks, including status_path.
config/settings/test.yml Adds test setting for ivc_champva.pega_api.status_path.
config/features.yml Adds the ivc_champva_cst_integration feature definition used by the job.

Comment thread modules/ivc_champva/spec/jobs/poll_pega_status_job_spec.rb Outdated
Comment thread modules/ivc_champva/spec/jobs/poll_pega_status_job_spec.rb Outdated
Comment thread modules/ivc_champva/spec/jobs/poll_pega_status_job_spec.rb
Comment thread modules/ivc_champva/app/jobs/ivc_champva/poll_pega_status_job.rb Outdated
Comment thread modules/ivc_champva/app/jobs/ivc_champva/poll_pega_status_job.rb
Comment thread modules/ivc_champva/app/jobs/ivc_champva/poll_pega_status_job.rb
Comment thread modules/ivc_champva/lib/pega_api/client.rb
Comment thread modules/ivc_champva/lib/pega_api/configuration.rb
Comment thread modules/ivc_champva/app/services/ivc_champva/file_uploader.rb
Comment thread config/features.yml Outdated
@va-vsp-bot
Copy link
Copy Markdown
Collaborator

⚠️ The following Parameter Store values are invalid. Please make sure the values are correct and exist in AWS Parameter Store before merging:

  • /dsva-vagov/vets-api/dev/env_vars/ivc_champva/pega_api/status_path
  • /dsva-vagov/vets-api/prod/env_vars/ivc_champva/pega_api/status_path
  • /dsva-vagov/vets-api/sandbox/env_vars/ivc_champva/pega_api/status_path
  • /dsva-vagov/vets-api/staging/env_vars/ivc_champva/pega_api/status_path

1 similar comment
@va-vsp-bot
Copy link
Copy Markdown
Collaborator

⚠️ The following Parameter Store values are invalid. Please make sure the values are correct and exist in AWS Parameter Store before merging:

  • /dsva-vagov/vets-api/dev/env_vars/ivc_champva/pega_api/status_path
  • /dsva-vagov/vets-api/prod/env_vars/ivc_champva/pega_api/status_path
  • /dsva-vagov/vets-api/sandbox/env_vars/ivc_champva/pega_api/status_path
  • /dsva-vagov/vets-api/staging/env_vars/ivc_champva/pega_api/status_path

@va-vsp-bot
Copy link
Copy Markdown
Collaborator

⚠️ The following Parameter Store values are invalid. Please make sure the values are correct and exist in AWS Parameter Store before merging:

  • /dsva-vagov/vets-api/dev/env_vars/ivc_champva/pega_api/status_path
  • /dsva-vagov/vets-api/prod/env_vars/ivc_champva/pega_api/status_path
  • /dsva-vagov/vets-api/sandbox/env_vars/ivc_champva/pega_api/status_path
  • /dsva-vagov/vets-api/staging/env_vars/ivc_champva/pega_api/status_path

@breedbah breedbah force-pushed the b_reed/cst-pega-cron-job branch from d868ef6 to 396b2ba Compare April 6, 2026 18:42
@va-vsp-bot
Copy link
Copy Markdown
Collaborator

⚠️ The following Parameter Store values are invalid. Please make sure the values are correct and exist in AWS Parameter Store before merging:

  • /dsva-vagov/vets-api/dev/env_vars/ivc_champva/pega_api/status_path
  • /dsva-vagov/vets-api/prod/env_vars/ivc_champva/pega_api/status_path
  • /dsva-vagov/vets-api/sandbox/env_vars/ivc_champva/pega_api/status_path
  • /dsva-vagov/vets-api/staging/env_vars/ivc_champva/pega_api/status_path

1 similar comment
@va-vsp-bot
Copy link
Copy Markdown
Collaborator

⚠️ The following Parameter Store values are invalid. Please make sure the values are correct and exist in AWS Parameter Store before merging:

  • /dsva-vagov/vets-api/dev/env_vars/ivc_champva/pega_api/status_path
  • /dsva-vagov/vets-api/prod/env_vars/ivc_champva/pega_api/status_path
  • /dsva-vagov/vets-api/sandbox/env_vars/ivc_champva/pega_api/status_path
  • /dsva-vagov/vets-api/staging/env_vars/ivc_champva/pega_api/status_path

@va-vsp-bot
Copy link
Copy Markdown
Collaborator

⚠️ The following Parameter Store values are invalid. Please make sure the values are correct and exist in AWS Parameter Store before merging:

  • /dsva-vagov/vets-api/dev/env_vars/ivc_champva/pega_api/status_path
  • /dsva-vagov/vets-api/prod/env_vars/ivc_champva/pega_api/status_path
  • /dsva-vagov/vets-api/sandbox/env_vars/ivc_champva/pega_api/status_path
  • /dsva-vagov/vets-api/staging/env_vars/ivc_champva/pega_api/status_path

@va-vsp-bot
Copy link
Copy Markdown
Collaborator

⚠️ The following Parameter Store values are invalid. Please make sure the values are correct and exist in AWS Parameter Store before merging:

  • /dsva-vagov/vets-api/dev/env_vars/ivc_champva/pega_api/status_path
  • /dsva-vagov/vets-api/prod/env_vars/ivc_champva/pega_api/status_path
  • /dsva-vagov/vets-api/sandbox/env_vars/ivc_champva/pega_api/status_path
  • /dsva-vagov/vets-api/staging/env_vars/ivc_champva/pega_api/status_path

@breedbah breedbah force-pushed the b_reed/cst-pega-cron-job branch from 8acbc96 to 7a38145 Compare April 6, 2026 18:49
@breedbah breedbah requested a review from Copilot April 6, 2026 18:50
breedbah and others added 6 commits April 9, 2026 14:37
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: breedbah <123968373+breedbah@users.noreply.github.com>
@breedbah breedbah force-pushed the b_reed/cst-pega-cron-job branch from 34421f8 to 6c77c49 Compare April 9, 2026 18:37
@va-vsp-bot
Copy link
Copy Markdown
Collaborator

👍 All Parameter Store values in this PR are valid

@va-vsp-bot
Copy link
Copy Markdown
Collaborator

👍 All Parameter Store values in this PR are valid

@va-vsp-bot
Copy link
Copy Markdown
Collaborator

👍 All Parameter Store values in this PR are valid

@github-actions github-actions Bot removed the missing-service-tag With a service tag, you can filter Datadog APM on a per-service level. label Apr 9, 2026
@va-vsp-bot
Copy link
Copy Markdown
Collaborator

👍 All Parameter Store values in this PR are valid

@va-vsp-bot
Copy link
Copy Markdown
Collaborator

👍 All Parameter Store values in this PR are valid

@va-vsp-bot
Copy link
Copy Markdown
Collaborator

👍 All Parameter Store values in this PR are valid

@va-vsp-bot
Copy link
Copy Markdown
Collaborator

👍 All Parameter Store values in this PR are valid

@va-vsp-bot
Copy link
Copy Markdown
Collaborator

👍 All Parameter Store values in this PR are valid

@breedbah breedbah merged commit f127fb7 into master Apr 13, 2026
44 of 45 checks passed
@breedbah breedbah deleted the b_reed/cst-pega-cron-job branch April 13, 2026 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants